package ua.kpi_java_training.morochenets.module2;

/**
 * The main class in which to run the process of life in the pool
 *
 * @author Ari100tell
 * @version 1.00.00
 * @data: 31.05.13
 * @time: 21:00
 */
public class LifeWaterSpace {


    /**
     * @param args not used
     */

    public static void main(String[] args) {
        new LifeWaterSpace().runLifeWaterSpace();
    }

    /**
     * Run simulations of life in the pool
     */
    public void runLifeWaterSpace() {
        InitialConditions initialConditions = new InitialConditions();
        initialConditions.inputAll();//запуск ввода
        Position position = new Position(initialConditions.getWidth(),initialConditions.getLength());
        Pool pool = new Pool(initialConditions.getWidth(),initialConditions.getLength());
        int[][] placesForLife = pool.completionPool();
        for (int i = 0; i < initialConditions.getNumberCycles(); i++) {
            placesForLife = position.changePosition(placesForLife);
            System.out.println("Шаг" + i);
            pool.outputPool(placesForLife);
        }
        StatisticalResults statisticalResults = new StatisticalResults();
        statisticalResults.outputAll(placesForLife);
    }
}
